import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
import _applyDecoratedDescriptor from "@babel/runtime/helpers/esm/applyDecoratedDescriptor";
import _isEmpty from "lodash/isEmpty";
import _filter from "lodash/filter";

var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _dec19, _class, _class2;

/**
 * fileUpload - 文件上传配置
 * @date: 2018-9-19

 */
import React, { PureComponent } from 'react';
import { Col, Form, Input, Row, Select } from 'antd';
import { connect } from 'dva';
import { Bind } from 'lodash-decorators';
import echarts from 'echarts';
import { Content, Header } from 'components/Page';
import Lov from 'components/Lov'; // import { Pie } from 'components/Charts';

import { Button as ButtonPermission } from 'components/Permission';
import intl from 'utils/intl';
import formatterCollections from 'utils/intl/formatterCollections';
import { getCurrentOrganizationId, isTenantRoleLevel } from 'utils/utils';
import notification from 'utils/notification';
import TableList from "./TableList";
import Drawer from "./Drawer";
import styles from "./index.less?modules";
var Option = Select.Option;
var formItemLayout = {
  labelCol: {
    span: 8
  },
  wrapperCol: {
    span: 16
  }
};
var tableOperatorStyle = {
  textAlign: 'right'
};
var FileUpload = (_dec = connect(function (_ref) {
  var fileUpload = _ref.fileUpload,
      loading = _ref.loading,
      user = _ref.user;
  return {
    fileUpload: fileUpload,
    user: user,
    fetchFileLoading: loading.effects['fileUpload/queryFileList'],
    saveHeaderLoading: loading.effects['fileUpload/saveHeader'],
    detailLoading: loading.effects['fileUpload/getUploadDetail'],
    saveDetailLoading: loading.effects['fileUpload/addConfigDetail'] || loading.effects['fileUpload/editConfigDetail'],
    tenantId: getCurrentOrganizationId()
  };
}), _dec2 = Form.create({
  fieldNameProp: null
}), _dec3 = formatterCollections({
  code: ['cfile.fileUpload']
}), _dec4 = Bind(), _dec5 = Bind(), _dec6 = Bind(), _dec7 = Bind(), _dec8 = Bind(), _dec9 = Bind(), _dec10 = Bind(), _dec11 = Bind(), _dec12 = Bind(), _dec13 = Bind(), _dec14 = Bind(), _dec15 = Bind(), _dec16 = Bind(), _dec17 = Bind(), _dec18 = Bind(), _dec19 = Bind(), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = /*#__PURE__*/function (_PureComponent) {
  _inherits(FileUpload, _PureComponent);

  var _super = _createSuper(FileUpload);

  function FileUpload() {
    var _this;

    _classCallCheck(this, FileUpload);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));
    _this.state = {
      visible: false,
      isCreate: false,
      nowTenantId: undefined,
      // 改变租户
      nowTenantName: undefined,
      // 租户名称
      newFileFormat: [],
      // 文件格式
      totalCapacity: 0,
      redisUsedCapacity: 0,
      totalCapacityUnit: 'MB'
    };
    _this.ref = React.createRef();
    return _this;
  }

  _createClass(FileUpload, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.queryFileList();
      var dispatch = this.props.dispatch;
      var lovCodes = {
        fileTypeList: 'CFLE.CONTENT_TYPE',
        fileFormatsList: 'CFLE.FILE_FORMAT',
        fileUnitList: 'CFLE.STORAGE_UNIT'
      };
      dispatch({
        type: 'fileUpload/init',
        payload: {
          lovCodes: lovCodes
        }
      });
      this.renderECharts();
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      clearTimeout(this.timer);
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate() {
      var _this$props$fileUploa = this.props.fileUpload.fileData,
          fileData = _this$props$fileUploa === void 0 ? {} : _this$props$fileUploa;
      var _this$state = this.state,
          totalCapacity = _this$state.totalCapacity,
          redisUsedCapacity = _this$state.redisUsedCapacity,
          totalCapacityUnit = _this$state.totalCapacityUnit;

      if (fileData.redisUsedCapacity !== redisUsedCapacity || fileData.totalCapacity !== totalCapacity || fileData.totalCapacityUnit !== totalCapacityUnit) {
        this.renderECharts();
      }
    }
    /**
     * 获取文件列表
     *
     * @param {*} [params={}]
     * @memberof FileUpload
     */

  }, {
    key: "queryFileList",
    value: function queryFileList() {
      var _this$props = this.props,
          dispatch = _this$props.dispatch,
          tenantId = _this$props.tenantId;
      this.setState({
        nowTenantId: tenantId
      });
      dispatch({
        type: 'fileUpload/queryFileList',
        payload: {
          tenantId: tenantId
        }
      });
    }
    /**
     * 获取当前租户下的文件列表
     */

  }, {
    key: "queryNowTenantFileList",
    value: function queryNowTenantFileList() {
      var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var dispatch = this.props.dispatch;
      var nowTenantId = this.state.nowTenantId;
      dispatch({
        type: 'fileUpload/queryFileList',
        payload: {
          page: _isEmpty(params) ? {} : params,
          tenantId: nowTenantId
        }
      });
    }
    /**
     * 获取文件类型
     *
     * @memberof FileUpload
     */

  }, {
    key: "queryFiletype",
    value: function queryFiletype() {
      var dispatch = this.props.dispatch;
      dispatch({
        type: 'fileUpload/queryFiletype'
      });
    }
    /**
     * 获取文件格式
     *
     * @memberof FileUpload
     */

  }, {
    key: "queryFileFormat",
    value: function queryFileFormat() {
      var dispatch = this.props.dispatch;
      dispatch({
        type: 'fileUpload/queryFileFormat'
      });
    }
    /**
     * 获取单位
     *
     * @memberof FileUpload
     */

  }, {
    key: "queryFileUnit",
    value: function queryFileUnit() {
      var dispatch = this.props.dispatch;
      dispatch({
        type: 'fileUpload/queryFileUnit'
      });
    }
    /**
     * 改变租户
     *
     * @param {*} val
     * @memberof FileUpload
     */

  }, {
    key: "changeOrganizationId",
    value: function changeOrganizationId(val, item) {
      var _this$props2 = this.props,
          dispatch = _this$props2.dispatch,
          form = _this$props2.form;
      form.resetFields();
      dispatch({
        type: 'fileUpload/queryFileList',
        payload: {
          tenantId: val
        }
      });
      this.setState({
        nowTenantId: val,
        nowTenantName: item.tenantName
      });
    }
    /**
     * 打开新增模态框
     *
     * @memberof FileUpload
     */

  }, {
    key: "showModal",
    value: function showModal() {
      var _this$props3 = this.props,
          dispatch = _this$props3.dispatch,
          _this$props3$fileUplo = _this$props3.fileUpload.fileFormatsList,
          fileFormatsList = _this$props3$fileUplo === void 0 ? [] : _this$props3$fileUplo;
      dispatch({
        type: 'fileUpload/updateState',
        payload: {
          fileDetail: {}
        }
      });
      this.setState({
        visible: true,
        isCreate: true,
        newFileFormat: fileFormatsList
      });
    }
    /**
     * 关闭模态框
     *
     * @memberof FileUpload
     */

  }, {
    key: "closeModal",
    value: function closeModal() {
      this.setState({
        visible: false,
        isCreate: false
      });
    }
    /**
     * 获取表格中的数据,打开编辑模态框
     *
     * @param {*} record
     * @memberof FileUpload
     */

  }, {
    key: "getRecordData",
    value: function getRecordData(record) {
      var _this$props4 = this.props,
          dispatch = _this$props4.dispatch,
          _this$props4$fileUplo = _this$props4.fileUpload.fileFormatsList,
          fileFormatsList = _this$props4$fileUplo === void 0 ? [] : _this$props4$fileUplo;
      var nowTenantId = this.state.nowTenantId;
      var _record$contentType = record.contentType,
          contentType = _record$contentType === void 0 ? [] : _record$contentType;

      var newFileFormat = _filter(fileFormatsList, function (item) {
        return contentType.indexOf(item.parentValue) >= 0;
      });

      dispatch({
        type: 'fileUpload/updateState',
        payload: {
          fileDetail: {}
        }
      });
      dispatch({
        type: 'fileUpload/getUploadDetail',
        payload: {
          uploadConfigId: record.uploadConfigId,
          tenantId: nowTenantId
        }
      });
      this.setState({
        visible: true,
        isCreate: false,
        newFileFormat: newFileFormat
      });
    }
    /**
     * 改变文件分类，设置文件格式状态
     * @param {*} newFileFormat
     */

  }, {
    key: "changeFileFormats",
    value: function changeFileFormats(newFileFormat) {
      this.setState({
        newFileFormat: newFileFormat
      });
    } // 保存头

  }, {
    key: "handleSaveHeader",
    value: function handleSaveHeader() {
      var _this$props5 = this.props,
          dispatch = _this$props5.dispatch,
          form = _this$props5.form,
          _this$props5$fileUplo = _this$props5.fileUpload.fileData,
          fileData = _this$props5$fileUplo === void 0 ? {} : _this$props5$fileUplo;
      var nowTenantId = this.state.nowTenantId;
      var _token = fileData._token,
          objectVersionNumber = fileData.objectVersionNumber,
          capacityConfigId = fileData.capacityConfigId,
          redisUsedCapacity = fileData.redisUsedCapacity,
          usedCapacity = fileData.usedCapacity,
          _fileData$listConfig = fileData.listConfig,
          listConfig = _fileData$listConfig === void 0 ? {} : _fileData$listConfig;
      form.validateFields(function (err, values) {
        if (!err) {
          dispatch({
            type: 'fileUpload/saveHeader',
            payload: _objectSpread(_objectSpread({
              tenantId: nowTenantId
            }, values), {}, {
              objectVersionNumber: objectVersionNumber,
              capacityConfigId: capacityConfigId,
              _token: _token
            })
          }).then(function (res) {
            if (res) {
              notification.success();
              dispatch({
                type: 'fileUpload/updateState',
                payload: {
                  fileData: _objectSpread(_objectSpread({}, res), {}, {
                    redisUsedCapacity: redisUsedCapacity,
                    usedCapacity: usedCapacity,
                    listConfig: listConfig
                  })
                }
              });
            }
          });
        }
      });
    }
    /**
     * 新建文件上传详细配置
     *
     * @param {*} value
     * @memberof FileUpload
     */

  }, {
    key: "handleAddConfigDetail",
    value: function handleAddConfigDetail(value) {
      var _this2 = this;

      var _this$props6 = this.props,
          dispatch = _this$props6.dispatch,
          _this$props6$fileUplo = _this$props6.fileUpload.pagination,
          pagination = _this$props6$fileUplo === void 0 ? {} : _this$props6$fileUplo;
      var nowTenantId = this.state.nowTenantId;
      dispatch({
        type: 'fileUpload/addConfigDetail',
        payload: _objectSpread({
          tenantId: nowTenantId
        }, value)
      }).then(function (res) {
        if (res) {
          _this2.closeModal();

          notification.success();

          _this2.queryNowTenantFileList(pagination);
        }
      });
    }
    /**
     * 编辑文件上传详细配置
     *
     * @param {*} value
     * @memberof FileUpload
     */

  }, {
    key: "handleEditConfigDetail",
    value: function handleEditConfigDetail(value) {
      var _this3 = this;

      var _this$props7 = this.props,
          dispatch = _this$props7.dispatch,
          _this$props7$fileUplo = _this$props7.fileUpload.pagination,
          pagination = _this$props7$fileUplo === void 0 ? {} : _this$props7$fileUplo;
      var nowTenantId = this.state.nowTenantId;
      dispatch({
        type: 'fileUpload/editConfigDetail',
        payload: _objectSpread({
          tenantId: nowTenantId
        }, value)
      }).then(function (res) {
        if (res) {
          _this3.closeModal();

          notification.success();

          _this3.queryNowTenantFileList(pagination);
        }
      });
    }
    /**
     *  删除文件上传详细配置
     *
     * @param {*} values
     * @memberof FormManage
     */

  }, {
    key: "handleDeleteConfigDetail",
    value: function handleDeleteConfigDetail(values) {
      var _this4 = this;

      var _this$props8 = this.props,
          dispatch = _this$props8.dispatch,
          _this$props8$fileUplo = _this$props8.fileUpload.pagination,
          pagination = _this$props8$fileUplo === void 0 ? {} : _this$props8$fileUplo;
      dispatch({
        type: 'fileUpload/deleteConfigDetail',
        payload: values
      }).then(function (res) {
        if (res) {
          _this4.queryNowTenantFileList(pagination);

          notification.success();
        }
      });
    }
  }, {
    key: "renderForm",
    value: function renderForm() {
      var _this$props9 = this.props,
          _this$props9$fileUplo = _this$props9.fileUpload,
          _this$props9$fileUplo2 = _this$props9$fileUplo.fileUnitList,
          fileUnitList = _this$props9$fileUplo2 === void 0 ? [] : _this$props9$fileUplo2,
          _this$props9$fileUplo3 = _this$props9$fileUplo.fileData,
          fileData = _this$props9$fileUplo3 === void 0 ? {} : _this$props9$fileUplo3,
          saveHeaderLoading = _this$props9.saveHeaderLoading,
          match = _this$props9.match;
      var getFieldDecorator = this.props.form.getFieldDecorator;
      var totalCapacity = fileData.totalCapacity,
          storageSize = fileData.storageSize;
      var fileMaxUnitSelector = getFieldDecorator('storageUnit', {
        initialValue: fileData.storageUnit ? fileData.storageUnit : 'MB'
      })( /*#__PURE__*/React.createElement(Select, {
        style: {
          width: '65px'
        }
      }, fileUnitList && fileUnitList.map(function (item) {
        return /*#__PURE__*/React.createElement(Option, {
          value: item.value,
          key: item.value
        }, item.meaning);
      })));
      var fileCapacityUnitSelector = getFieldDecorator('totalCapacityUnit', {
        initialValue: fileData.totalCapacityUnit ? fileData.totalCapacityUnit : 'MB'
      })( /*#__PURE__*/React.createElement(Select, {
        style: {
          width: '65px'
        }
      }, fileUnitList && fileUnitList.map(function (item) {
        return /*#__PURE__*/React.createElement(Option, {
          value: item.value,
          key: item.value
        }, item.meaning);
      }))); // const piePercent =
      //   ((fileData.redisUsedCapacity
      //     ? fileData.totalCapacityUnit === 'MB'
      //       ? Math.round(fileData.redisUsedCapacity / 1024 / 1024)
      //       : Math.round(fileData.redisUsedCapacity / 1024)
      //     : 0) /
      //     (fileData.totalCapacity ? fileData.totalCapacity : 1)) *
      //   100;

      return /*#__PURE__*/React.createElement(Form, null, /*#__PURE__*/React.createElement(Row, {
        type: "flex"
      }, /*#__PURE__*/React.createElement(Col, {
        span: 12
      }, /*#__PURE__*/React.createElement(Row, {
        type: "flex",
        gutter: 24,
        align: "bottom"
      }, /*#__PURE__*/React.createElement(Col, {
        span: 16
      }, /*#__PURE__*/React.createElement(Form.Item, Object.assign({
        label: intl.get('cfile.fileUpload.model.fileUpload.totalCapacity').d('最大容量')
      }, formItemLayout), getFieldDecorator('totalCapacity', {
        rules: [{
          required: true,
          message: intl.get('cpaas.common.validation.notNull', {
            name: intl.get('cfile.fileUpload.model.fileUpload.totalCapacity').d('最大容量')
          })
        }, {
          min: 0,
          pattern: /^\d+$/,
          message: intl.get('cfile.fileUpload.view.message.patternValidate').d('请输入大于等于0的整数')
        }],
        initialValue: totalCapacity
      })( /*#__PURE__*/React.createElement(Input, {
        type: "number",
        addonAfter: fileCapacityUnitSelector
      }))))), /*#__PURE__*/React.createElement(Row, {
        type: "flex",
        gutter: 24,
        align: "bottom"
      }, /*#__PURE__*/React.createElement(Col, {
        span: 16
      }, /*#__PURE__*/React.createElement(Form.Item, Object.assign({
        label: intl.get('cfile.fileUpload.model.fileUpload.storageSize').d('文件大小限制')
      }, formItemLayout), getFieldDecorator('storageSize', {
        rules: [{
          required: true,
          message: intl.get('cpaas.common.validation.notNull', {
            name: intl.get('cfile.fileUpload.model.fileUpload.storageSize').d('文件大小限制')
          })
        }, {
          min: 0,
          pattern: /^\d+$/,
          message: intl.get('cfile.fileUpload.view.message.patternValidate').d('请输入大于等于0的整数')
        }],
        initialValue: storageSize
      })( /*#__PURE__*/React.createElement(Input, {
        type: "number",
        addonAfter: fileMaxUnitSelector
      })))), /*#__PURE__*/React.createElement(Col, {
        span: 4,
        className: styles.buttonSave
      }, /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(ButtonPermission, {
        "data-code": "search",
        type: "primary",
        htmlType: "submit",
        onClick: this.handleSaveHeader,
        loading: saveHeaderLoading,
        permissionList: [{
          code: "".concat(match.path, ".button.save"),
          type: 'button',
          meaning: '文件上传配置-保存'
        }]
      }, intl.get('cpaas.common.button.save').d('保存')))))), /*#__PURE__*/React.createElement(Col, {
        span: 12
      }, /*#__PURE__*/React.createElement(Col, {
        span: 8,
        className: styles.pie
      }, /*#__PURE__*/React.createElement("div", {
        ref: this.ref,
        style: {
          height: 200
        }
      })))));
    }
    /**
     * 渲染已使用容量的显示图表
     */

  }, {
    key: "renderECharts",
    value: function renderECharts() {
      var _this5 = this;

      if (this.ref.current) {
        var eTable = echarts.init(this.ref.current);
        var _this$props$fileUploa2 = this.props.fileUpload.fileData,
            fileData = _this$props$fileUploa2 === void 0 ? {} : _this$props$fileUploa2;
        this.setState({
          totalCapacity: fileData.totalCapacity,
          redisUsedCapacity: fileData.redisUsedCapacity,
          totalCapacityUnit: fileData.totalCapacityUnit
        }); // eslint-disable-next-line no-nested-ternary

        var redisUsedCapacity = fileData.redisUsedCapacity ? fileData.totalCapacityUnit === 'MB' ? Math.round(fileData.redisUsedCapacity / 1024 / 1024) : Math.round(fileData.redisUsedCapacity / 1024) : 0;
        var pieTotal = "".concat(redisUsedCapacity, "/").concat(fileData.totalCapacity ? fileData.totalCapacity : 0, "(").concat(fileData.totalCapacityUnit ? fileData.totalCapacityUnit : 'MB', ")");
        var capacityNumber = fileData.totalCapacity ? fileData.totalCapacity : 0;
        var unusedCapacity = capacityNumber - redisUsedCapacity;
        var data = capacityNumber === 0 ? [{
          value: 0,
          name: intl.get('cfile.fileUpload.model.fileUpload.redisUnusedCapacity').d('未使用容量')
        }] : [{
          value: redisUsedCapacity,
          name: intl.get('cfile.fileUpload.model.fileUpload.redisUsedCapacity').d('已使用容量')
        }, {
          value: unusedCapacity > 0 ? unusedCapacity : 0,
          name: intl.get('cfile.fileUpload.model.fileUpload.redisUnusedCapacity').d('未使用容量')
        }];
        var option = {
          title: {
            text: "".concat(intl.get('cfile.fileUpload.model.fileUpload.redisUsedCapacity').d('已使用容量'), "\n\n").concat(pieTotal),
            left: 'center',
            top: 'center',
            textStyle: {
              fontWeight: '500',
              fontSize: 13,
              color: 'rgba(0, 0, 0, 0.85)'
            }
          },
          color: capacityNumber === 0 ? ['#f0f2f5'] : ['#29bece', '#f0f2f5'],
          tooltip: {},
          series: [{
            type: 'pie',
            radius: ['65%', '90%'],
            label: {
              normal: {
                show: false,
                position: 'center'
              }
            },
            labelLine: {
              normal: {
                show: false
              }
            },
            data: data
          }]
        };
        eTable.setOption(option);
      } else {
        this.timer = setTimeout(function () {
          _this5.renderECharts();
        }, 200);
      }
    }
  }, {
    key: "render",
    value: function render() {
      var _this6 = this;

      var _this$props10 = this.props,
          match = _this$props10.match,
          _this$props10$user$cu = _this$props10.user.currentUser,
          organizationId = _this$props10$user$cu.organizationId,
          tenantName = _this$props10$user$cu.tenantName,
          _this$props10$fileUpl = _this$props10.fileUpload,
          _this$props10$fileUpl2 = _this$props10$fileUpl.fileData.listConfig,
          listConfig = _this$props10$fileUpl2 === void 0 ? {} : _this$props10$fileUpl2,
          _this$props10$fileUpl3 = _this$props10$fileUpl.fileTypeList,
          fileTypeList = _this$props10$fileUpl3 === void 0 ? [] : _this$props10$fileUpl3,
          _this$props10$fileUpl4 = _this$props10$fileUpl.fileFormatsList,
          fileFormatsList = _this$props10$fileUpl4 === void 0 ? [] : _this$props10$fileUpl4,
          _this$props10$fileUpl5 = _this$props10$fileUpl.fileUnitList,
          fileUnitList = _this$props10$fileUpl5 === void 0 ? [] : _this$props10$fileUpl5,
          _this$props10$fileUpl6 = _this$props10$fileUpl.pagination,
          pagination = _this$props10$fileUpl6 === void 0 ? {} : _this$props10$fileUpl6,
          _this$props10$fileUpl7 = _this$props10$fileUpl.fileDetail,
          fileDetail = _this$props10$fileUpl7 === void 0 ? {} : _this$props10$fileUpl7,
          fetchFileLoading = _this$props10.fetchFileLoading,
          saveDetailLoading = _this$props10.saveDetailLoading,
          _this$props10$detailL = _this$props10.detailLoading,
          detailLoading = _this$props10$detailL === void 0 ? false : _this$props10$detailL;
      var _this$state2 = this.state,
          visible = _this$state2.visible,
          isCreate = _this$state2.isCreate,
          _this$state2$newFileF = _this$state2.newFileFormat,
          newFileFormat = _this$state2$newFileF === void 0 ? [] : _this$state2$newFileF,
          nowTenantId = _this$state2.nowTenantId,
          nowTenantName = _this$state2.nowTenantName;
      var drawerProps = {
        visible: visible,
        isCreate: isCreate,
        detailLoading: detailLoading,
        fileDetail: fileDetail,
        fileTypeList: fileTypeList,
        fileFormatsList: fileFormatsList,
        fileUnitList: fileUnitList,
        newFileFormat: newFileFormat,
        anchor: 'right',
        saving: saveDetailLoading,
        onCancel: this.closeModal,
        onAdd: this.handleAddConfigDetail,
        onEdit: this.handleEditConfigDetail,
        onChangeFileFormats: this.changeFileFormats
      };
      var listProps = {
        pagination: pagination,
        listConfig: listConfig,
        match: match,
        loading: fetchFileLoading,
        onGetRecordData: this.getRecordData,
        onDelete: this.handleDeleteConfigDetail,
        onChangePage: this.queryNowTenantFileList
      };
      return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, {
        title: intl.get('cfile.fileUpload.view.message.title').d('文件上传配置')
      }, !isTenantRoleLevel() && /*#__PURE__*/React.createElement(Lov, {
        style: {
          width: 200,
          marginLeft: 8
        },
        value: organizationId,
        textValue: nowTenantId === organizationId ? tenantName : nowTenantName,
        code: "CPFM.TENANT",
        onChange: function onChange(val, item) {
          _this6.changeOrganizationId(val, item);
        },
        allowClear: false
      })), /*#__PURE__*/React.createElement(Content, null, this.renderForm(), /*#__PURE__*/React.createElement("div", {
        className: "table-list-search",
        style: tableOperatorStyle
      }, /*#__PURE__*/React.createElement(ButtonPermission, {
        type: "primary",
        permissionList: [{
          code: "".concat(match.path, ".button.add"),
          type: 'button',
          meaning: '文件上传配置-添加详细配置'
        }],
        onClick: function onClick() {
          return _this6.showModal();
        }
      }, intl.get('cfile.fileUpload.view.button.add').d('添加详细配置'))), /*#__PURE__*/React.createElement(TableList, listProps)), /*#__PURE__*/React.createElement(Drawer, drawerProps));
    }
  }]);

  return FileUpload;
}(PureComponent), (_applyDecoratedDescriptor(_class2.prototype, "queryFileList", [_dec4], Object.getOwnPropertyDescriptor(_class2.prototype, "queryFileList"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "queryNowTenantFileList", [_dec5], Object.getOwnPropertyDescriptor(_class2.prototype, "queryNowTenantFileList"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "queryFiletype", [_dec6], Object.getOwnPropertyDescriptor(_class2.prototype, "queryFiletype"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "queryFileFormat", [_dec7], Object.getOwnPropertyDescriptor(_class2.prototype, "queryFileFormat"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "queryFileUnit", [_dec8], Object.getOwnPropertyDescriptor(_class2.prototype, "queryFileUnit"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "changeOrganizationId", [_dec9], Object.getOwnPropertyDescriptor(_class2.prototype, "changeOrganizationId"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "showModal", [_dec10], Object.getOwnPropertyDescriptor(_class2.prototype, "showModal"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "closeModal", [_dec11], Object.getOwnPropertyDescriptor(_class2.prototype, "closeModal"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "getRecordData", [_dec12], Object.getOwnPropertyDescriptor(_class2.prototype, "getRecordData"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "changeFileFormats", [_dec13], Object.getOwnPropertyDescriptor(_class2.prototype, "changeFileFormats"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleSaveHeader", [_dec14], Object.getOwnPropertyDescriptor(_class2.prototype, "handleSaveHeader"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleAddConfigDetail", [_dec15], Object.getOwnPropertyDescriptor(_class2.prototype, "handleAddConfigDetail"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleEditConfigDetail", [_dec16], Object.getOwnPropertyDescriptor(_class2.prototype, "handleEditConfigDetail"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleDeleteConfigDetail", [_dec17], Object.getOwnPropertyDescriptor(_class2.prototype, "handleDeleteConfigDetail"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "renderForm", [_dec18], Object.getOwnPropertyDescriptor(_class2.prototype, "renderForm"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "renderECharts", [_dec19], Object.getOwnPropertyDescriptor(_class2.prototype, "renderECharts"), _class2.prototype)), _class2)) || _class) || _class) || _class);
export { FileUpload as default };